<template>
  <div>
    child2
    <div class="swiper-container">
      <div class="swiper-wrapper">
        <div class="swiper-slide">Slide 11111</div>
        <div class="swiper-slide">Slide 22222</div>
        <div class="swiper-slide">Slide 333333</div>
      </div>
      <!-- 如果需要分页器 -->
      <div class="swiper-pagination"></div>

      <!-- 如果需要导航按钮 -->
      <div class="swiper-button-prev"></div>
      <div class="swiper-button-next"></div>

      <!-- 如果需要滚动条 -->
      <!-- <div class="swiper-scrollbar"></div>-->
    </div>
  </div>
</template>

<script>
import Swiper from 'swiper'
import 'swiper/dist/css/swiper.css'

export default {
  name: 'child2',
  mounted () {
    // eslint-disable-next-line no-new
    new Swiper('.swiper-container', {
      pagination: {
        el: '.swiper-pagination'
      },
      // direction: 'vertical',
      loop: true,
      autoplay: {
        delay: 2500,
        disableOnInteraction: false
      },
      // 如果需要前进后退按钮
      navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev'
      }

    })
  }

}
</script>

<style lang="scss" scoped>
div {
  background: yellow;
}
.swiper-container {
  height: 300px;
}
</style>
